#!/usr/bin/python3
import time

if __name__ == "__main__":
    print("start......")
    ding_file = '/home/ubuntu/ydn/yuce-data/ydndata'
    with open(ding_file, 'r',encoding='UTF-8') as f:
        data_list = f.readlines()
        print(len(data_list))

        str_tmp_shi_list = []
        str_tmp_bai_list = []
        str_tmp_qian_list = []
        str_tmp_wan_list = []
        tatil_shi = f"           \t0\t1\t2\t3\t4\t5\t6\t7\t8\t9"

        str_tmp_shi_list.append(tatil_shi)
        str_tmp_bai_list.append(tatil_shi)
        str_tmp_qian_list.append(tatil_shi)
        str_tmp_wan_list.append(tatil_shi)

        for i in range(len(data_list)):
            if "start" in data_list[i]:
                #print(data_list[i+5][-6:])
                #print(data_list[i+7][-9:-3])

                str_tmp_shi = data_list[i+5][-6:].strip("\n") + \
                          data_list[i+7][-9:-3].strip("\n") + \
                          data_list[i + 9]
                str_tmp_shi_list.append(str_tmp_shi)

                str_tmp_bai = data_list[i+5][-6:].strip("\n") + \
                          data_list[i+11][-9:-3].strip("\n") + \
                          data_list[i + 13]
                str_tmp_bai_list.append(str_tmp_bai)

                str_tmp_qian = data_list[i+5][-6:].strip("\n") + \
                          data_list[i+15][-9:-3].strip("\n") + \
                          data_list[i + 17]
                str_tmp_qian_list.append(str_tmp_qian)

                str_tmp_wan= data_list[i+5][-6:].strip("\n") + \
                          data_list[i+19][-9:-3].strip("\n") + \
                          data_list[i + 21]
                str_tmp_wan_list.append(str_tmp_wan)

        #print(str_tmp_wan_list)
        print("********----------------万位----------------")
        for i in str_tmp_wan_list:
            print(i)
        print('\n')
        print("********----------------千位----------------")
        for i in str_tmp_qian_list:
            print(i)
        print('\n')
        print("********----------------百位----------------")
        for i in str_tmp_bai_list:
            print(i)
        print('\n')
        print("********----------------十位----------------")
        for i in str_tmp_shi_list:
            print(i)
